package com.ruoyi.flow.flow.identity.activiti.entity;

import com.ruoyi.flow.flow.identity.activiti.enums.Gender;
import com.ruoyi.flow.flow.identity.activiti.enums.GenderConverter;
import com.ruoyi.flow.flow.identity.activiti.enums.Status;
import org.activiti.engine.identity.Picture;
import org.activiti.engine.impl.persistence.entity.AbstractEntity;
import org.activiti.engine.impl.persistence.entity.ByteArrayRef;
import org.activiti.engine.impl.persistence.entity.UserEntity;

import javax.persistence.*;

/**
 * @author wtian
 * @version 1.0
 * @since 2018/9/5 11:13
 */
@Entity
@Table(name = "NB_USER")
public class FlowUser extends AbstractEntity implements UserEntity {
    @Column(name = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "userSeq")
    @SequenceGenerator(name = "userSeq", sequenceName = "SEQ_GROUPID")
    private Integer userid;
    @Column(name = "username")
    private String id;
    @Column(name = "password")
    private String password;
    @Column(name = "realname")
    private String firstName;
    @Column(name = "gender")
    @Convert(converter = GenderConverter.class)
    private Gender gender;
    @Column(name = "status")
    @Enumerated
    private Status status;
    @Column(name = "policeno")
    private String policeNo;

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public void setPassword(String password) {
        this.password = password;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public String getPoliceNo() {
        return policeNo;
    }

    public void setPoliceNo(String policeNo) {
        this.policeNo = policeNo;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String getFirstName() {
        return firstName;
    }

    @Override
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    @Override
    public void setLastName(String lastName) {
        setLastName("");
    }

    @Override
    public String getLastName() {
        return "";
    }

    @Override
    public void setEmail(String email) {

    }

    @Override
    public String getEmail() {
        return "";
    }

    @Override
    public boolean isPictureSet() {
        return false;
    }

    @Override
    public Picture getPicture() {
        return null;
    }

    @Override
    public void setPicture(Picture picture) {

    }

    @Override
    public ByteArrayRef getPictureByteArrayRef() {
        return null;
    }

    @Override
    public Object getPersistentState() {
        return null;
    }
}
